home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / ICON_8 / H_FOLDER / CPUCONF.H < prev    next >
Text File  |  1990-03-02  |  5KB  |  177 lines

  1. /*
  2.  *  Configuration parameters that depend on computer architecture.
  3.  *  Some depend on values defined in config.h, which is always
  4.  *  included before this file.
  5.  */
  6.  
  7. #ifndef CStateSize
  8. #define CStateSize 15            /* size of C state for co-expressions */
  9. #endif                    /* CStateSize */
  10.  
  11. /*
  12.  * The following definitions depend on the sizes of ints and pointers.
  13.  */
  14.  
  15. /*
  16.  * Most of the present implementations use 32-bit "words".  The section
  17.  *  for 64-bit words is tentative and untested.  16-bit words are no
  18.  *  longer supported.  Note that WordBits is the number of bits in an Icon
  19.  *  integer, not necessarily the number of bits in an int (given by IntBits).
  20.  *  For example, in MS-DOS an Icon integer is a long, not an int.
  21.  *
  22.  *  MaxStrLen must not be so large as to overlap flags.
  23.  */
  24.  
  25. /*
  26.  * 64-bit words.  NOTE:  This section is under construction!
  27.  */
  28.  
  29. #if WordBits == 64
  30.  
  31. #define MinLong  ((long int)0x8000000000000000) /* smallest long integer */
  32. #define MaxLong  ((long int)0x7fffffffffffffff) /* largest long integer */
  33. #define MaxDigits 40        /* maximum number of digits in images */
  34. #define MaxStrLen 017777777777L /* maximum string length */
  35. #define MaxNegInt "-9223372036854775808"
  36.  
  37. #define F_Nqual 0x8000000000000000    /* set if NOT string qualifier */
  38. #define F_Var    0x4000000000000000    /* set if variable */
  39. #define F_Tvar    0x2000000000000000    /* set if trapped variable */
  40. #define F_Ptr    0x1000000000000000    /* set if value field is pointer */
  41.  
  42. #endif                    /* WordBits == 64 */
  43.  
  44. /*
  45.  * 32-bit words.
  46.  */
  47.  
  48. #if WordBits == 32
  49.  
  50. #define MaxLong  ((long int)017777777777L)   /* largest long integer */
  51. #define MinLong  ((long int)020000000000L)   /* smallest long integer */
  52. #define MaxDigits 20        /* maximum number of digits in images */
  53.  
  54. #define MaxNegInt "-2147483648"
  55.  
  56. #define MaxStrLen         0777777777    /* maximum string length */
  57.  
  58. #define F_Nqual 0x80000000        /* set if NOT string qualifier */
  59. #define F_Var    0x40000000        /* set if variable */
  60. #define F_Tvar    0x20000000        /* set if trapped variable */
  61. #define F_Ptr    0x10000000        /* set if value field is pointer */
  62. #endif                    /* WordBits == 32 */
  63.  
  64. /* Values that depend on the number of bits in an int (not necessarily
  65.  * the same as the number of bits in a word).
  66.  */
  67.  
  68. #if IntBits == 64
  69. #define LogIntBits            6    /* log of IntBits */
  70. #define MaxUnsigned 01777777777777777777777L /* largest unsigned integer */
  71. #define MaxInt         0777777777777777777777L /* largest int */
  72. /*
  73.  * Cset initialization macros.
  74.  */
  75. #define fwd(w0, w1, w2, w3) \
  76.  ((w0)&0xffff : ((w1)&0xffff)<<16 : ((w2)&0xffff)<<32 : ((w3)&0xffff)<<48)
  77. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  78.  {fwd(w0,w1,w2,w3),fwd(w4,w5,w6,w7),fwd(w8,w9,wa,wb),fwd(wc,wd,we,wf)}
  79. #endif                    /* IntBits == 64 */
  80.  
  81. #if IntBits == 32
  82. #define LogIntBits            5    /* log of IntBits */
  83. #define MaxUnsigned      037777777777    /* largest unsigned integer */
  84. #define MaxInt           07777777777    /* largest int */
  85. /*
  86.  * Cset initialization macros.
  87.  */
  88. #define twd(w0,w1)    ((w0)&0xffff | (w1)<<16)
  89. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  90.     {twd(w0,w1),twd(w2,w3),twd(w4,w5),twd(w6,w7), \
  91.      twd(w8,w9),twd(wa,wb),twd(wc,wd),twd(we,wf)}
  92. #endif                    /* IntBits == 32 */
  93.  
  94. #if IntBits == 16
  95. #define LogIntBits                4    /* log of IntBits */
  96. #define MaxUnsigned ((unsigned int)0177777)    /* largest unsigned integer */
  97. #define MaxInt              077777    /* largest int */
  98. /*
  99.  * Cset initialization macro.
  100.  */
  101. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  102.     {w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf}
  103. #endif                    /* IntBits == 16 */
  104.  
  105. #ifndef LogHuge
  106. #define LogHuge 309            /* maximum base-10 exp+1 of real */
  107. #endif                    /* LogHuge */
  108.  
  109. #ifndef Big
  110. #define Big 9007199254740992.        /* larger than 2^53 lose precision */
  111. #endif                    /* Big */
  112.  
  113. #ifndef Precision
  114. #define Precision 10            /* digits in string from real */
  115. #endif                    /* Precision */
  116.  
  117. /*
  118.  * Parameters that configure tables and sets:
  119.  *
  120.  *  HSlots    Initial number of hash buckets; must be a power of 2.
  121.  *  LogHSlots    Log to the base 2 of HSlots.
  122.  *
  123.  *  HSegs    Maximum number of hash bin segments; the maximum number of
  124.  *        hash bins is HSlots * 2 ^ (HSegs - 1).
  125.  *
  126.  *        If Hsegs is increased above 12, the arrays log2[] and segsize[]
  127.  *        in iconx will need modification.
  128.  *
  129.  *  MaxHLoad    Maximum loading factor; more hash bins are allocated when
  130.  *        the average bin exceeds this many entries.
  131.  *
  132.  *  MinHLoad    Minimum loading factor; if a newly created table (e.g. via
  133.  *        copy()) is more lightly loaded than this, bins are combined.
  134.  *
  135.  *  Because splitting doubles the number of hash bins, and combining halves it,
  136.  *  MaxHLoad should be at least twice MinHLoad.
  137.  */
  138.  
  139. #ifndef HSlots
  140. #if IntBits == 16
  141. #define HSlots     4
  142. #define LogHSlots  2
  143. #else
  144. #define HSlots     8
  145. #define LogHSlots  3
  146. #endif                    /* IntBits */
  147. #endif                    /* HSlots */
  148.  
  149. #if ((1 << LogHSlots) != HSlots)
  150. Deliberate Syntax Error -- HSlots and LogHSlots are inconsistent
  151. #endif                    /* HSlots / LogHSlots consistency */
  152.  
  153. #ifndef HSegs
  154. #if IntBits == 16
  155. #define HSegs      6
  156. #else
  157. #define HSegs     10
  158. #endif                    /* IntBits */
  159. #endif                    /* HSegs */
  160.  
  161. #ifndef MinHLoad
  162. #define MinHLoad  1
  163. #endif                    /* MinHLoad */
  164.  
  165. #ifndef MaxHLoad
  166. #define MaxHLoad  5
  167. #endif                    /* MaxHLoad */
  168.  
  169. /*
  170.  * The number of bits in each base-B digit; the type DIGIT (unsigned int)
  171.  *  in rt.h must be large enough to hold this many bits.
  172.  *  It must be at least 2 and at most WordBits / 2.
  173.  */
  174.  
  175. #define NB           (WordBits / 2)
  176.  
  177.